import React,{ Component } from "react";
export default  class Weather extends Component {
   constructor(props){
       super(props)
       this.textChange=this.textChange.bind(this);
  
   }
   state={
           isHot:true
       }
   textChange=()=>{
       let { isHot}=this.state;
     this.setState({
         isHot:!isHot
     })
   }
   render(){
           let {isHot}=this.state;
       return(
           <h1 onClick={this.textChange}>今天天气很{ isHot ? "炎热":"凉爽"}</h1>
       )
   }

}